class Student(object):
    count = 0
    def __init__(self, name, score):
        self.name = name
        self.score = score  # 为Student这个类本身定义一个属性
        # 可以认为每次创建一个学生的实例都是使用了这个类的第一个方法，每次使用这个方法时将类属性加1即可
        Student.count = Student.count + 1

    def print_score(self):
        print('%s:%s' % (self.name, self.score))


xiaohong = Student('xiaohong', 99)
xiaobai = Student('xiaobai', 77)
xiaohong = Student('xiaohong', 99)
xiaobai = Student('xiaobai', 77)
xiaohong = Student('xiaohong', 99)
xiaobai = Student('xiaobai', 77)
xiaohong = Student('xiaohong', 99)
xiaobai = Student('xiaobai', 77)
xiaohong = Student('xiaohong', 99)
xiaobai = Student('xiaobai', 77)
print('学生总人数：', Student.count)